package oving6;
import java.lang.Comparable;
public class Card implements Comparable<Card>{
	String suit;
	int face;
	
	public Card(String suit, int face){
		if(suit=="S"||suit=="H"||suit=="D"||suit=="C"){
			this.suit=suit;
		}
		else{
			this.suit=null;
		}
		if(face<=13&&face>=1){
			this.face=face;
		}
		else{
			this.face=-1;
		}
	}
	public String getSuit(){
		return suit;
	}
	public int getFace(){
		return face;
	}
	public String toString(){
			return (suit+face);
	}
	
	public int getFaceV(){
		if(face==1){
			return 14;
		}
		else{
			return face;
		}
	}
	
	public int compareTo(Card c) {
		if(c.getFaceV()>getFaceV()){
			
			return -1;
		}
		else if(c.getFaceV()<getFaceV()){
			return 1;
		}
		else{
			return getSuit().compareTo(c.getSuit());
		}
	}
	

}
